package minimips.isa.rtype;

import minimips.isa.Instruction;

public abstract class RTypeInstruction extends Instruction {

	private RTypeSpecification properties;
	
	public RTypeInstruction(long memoryAddress, int opcode, String instructionToken, int rs, int rt, int rd, int extra, int function) {
		super(memoryAddress, opcode, instructionToken);
		this.properties = new RTypeSpecification(opcode, rs, rt, rd, extra, function);
	}

	public int getOpcode() {
		return properties.getOpcode();
	}



	public int getRs() {
		return properties.getRs();
	}



	public int getRt() {
		return properties.getRt();
	}



	public int getRd() {
		return properties.getRd();
	}



	public int getExtra() {
		return properties.getExtra();
	}



	public int getFunction() {
		return properties.getFunction();
	}



	public int getMachineCode() {
		return properties.getMachineCode();
	}

	@Override
	public String toString() {
		return this.getInstructionName() + " " + this.properties.getRd() + ", " + this.properties.getRs() + ", " + this.properties.getRt();
	}

}
